
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Introduction · TypeScript Handbook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="Patrick Zhong">
        
        
    
    <link rel="stylesheet" href="gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="doc/handbook/tutorials/" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter active" data-level="1.1" data-path="./">
            
                <a href="./">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="doc/handbook/tutorials/">
            
                <a href="doc/handbook/tutorials/">
            
                    
                    快速上手
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="doc/handbook/tutorials/TypeScript in 5 minutes.html">
            
                <a href="doc/handbook/tutorials/TypeScript in 5 minutes.html">
            
                    
                    5分钟了解TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="doc/handbook/tutorials/ASP.NET Core.html">
            
                <a href="doc/handbook/tutorials/ASP.NET Core.html">
            
                    
                    ASP.NET Core
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="doc/handbook/tutorials/ASP.NET 4.html">
            
                <a href="doc/handbook/tutorials/ASP.NET 4.html">
            
                    
                    ASP.NET 4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="doc/handbook/tutorials/Gulp.html">
            
                <a href="doc/handbook/tutorials/Gulp.html">
            
                    
                    Gulp
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="doc/handbook/tutorials/Knockout.html">
            
                <a href="doc/handbook/tutorials/Knockout.html">
            
                    
                    Knockout.js
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="doc/handbook/tutorials/React & Webpack.html">
            
                <a href="doc/handbook/tutorials/React & Webpack.html">
            
                    
                    React与webpack
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.7" data-path="doc/handbook/tutorials/React.html">
            
                <a href="doc/handbook/tutorials/React.html">
            
                    
                    React
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="doc/handbook/tutorials/Angular 2.html">
            
                <a href="doc/handbook/tutorials/Angular 2.html">
            
                    
                    Angular 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.9" data-path="doc/handbook/tutorials/Migrating from JavaScript.html">
            
                <a href="doc/handbook/tutorials/Migrating from JavaScript.html">
            
                    
                    从JavaScript迁移到TypeScript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="doc/handbook/">
            
                <a href="doc/handbook/">
            
                    
                    手册
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="doc/handbook/Basic Types.html">
            
                <a href="doc/handbook/Basic Types.html">
            
                    
                    基础类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="doc/handbook/Variable Declarations.html">
            
                <a href="doc/handbook/Variable Declarations.html">
            
                    
                    变量声明
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="doc/handbook/Interfaces.html">
            
                <a href="doc/handbook/Interfaces.html">
            
                    
                    接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="doc/handbook/Classes.html">
            
                <a href="doc/handbook/Classes.html">
            
                    
                    类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="doc/handbook/Functions.html">
            
                <a href="doc/handbook/Functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="doc/handbook/Generics.html">
            
                <a href="doc/handbook/Generics.html">
            
                    
                    泛型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="doc/handbook/Enums.html">
            
                <a href="doc/handbook/Enums.html">
            
                    
                    枚举
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="doc/handbook/Type Inference.html">
            
                <a href="doc/handbook/Type Inference.html">
            
                    
                    类型推论
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="doc/handbook/Type Compatibility.html">
            
                <a href="doc/handbook/Type Compatibility.html">
            
                    
                    类型兼容性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="doc/handbook/Advanced Types.html">
            
                <a href="doc/handbook/Advanced Types.html">
            
                    
                    高级类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="doc/handbook/Utilit Types.md">
            
                <span>
            
                    
                    实用工具类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="doc/handbook/Symbols.html">
            
                <a href="doc/handbook/Symbols.html">
            
                    
                    Symbols
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="doc/handbook/Iterators and Generators.html">
            
                <a href="doc/handbook/Iterators and Generators.html">
            
                    
                    Iterators 和 Generators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="doc/handbook/Modules.html">
            
                <a href="doc/handbook/Modules.html">
            
                    
                    模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.15" data-path="doc/handbook/Namespaces.html">
            
                <a href="doc/handbook/Namespaces.html">
            
                    
                    命名空间
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.16" data-path="doc/handbook/Namespaces and Modules.html">
            
                <a href="doc/handbook/Namespaces and Modules.html">
            
                    
                    命名空间和模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.17" data-path="doc/handbook/Module Resolution.html">
            
                <a href="doc/handbook/Module Resolution.html">
            
                    
                    模块解析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.18" data-path="doc/handbook/Declaration Merging.html">
            
                <a href="doc/handbook/Declaration Merging.html">
            
                    
                    声明合并
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.19" data-path="doc/handbook/Writing Definition Files.html">
            
                <a href="doc/handbook/Writing Definition Files.html">
            
                    
                    书写.d.ts文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.20" data-path="doc/handbook/JSX.html">
            
                <a href="doc/handbook/JSX.html">
            
                    
                    JSX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.21" data-path="doc/handbook/Decorators.html">
            
                <a href="doc/handbook/Decorators.html">
            
                    
                    Decorators
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.22" data-path="doc/handbook/Mixins.html">
            
                <a href="doc/handbook/Mixins.html">
            
                    
                    混入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.23" data-path="doc/handbook/Triple-Slash Directives.html">
            
                <a href="doc/handbook/Triple-Slash Directives.html">
            
                    
                    三斜线指令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.24" data-path="doc/handbook/Type Checking JavaScript Files.html">
            
                <a href="doc/handbook/Type Checking JavaScript Files.html">
            
                    
                    JavaScript文件里的类型检查
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="doc/handbook/declaration files/Introduction.html">
            
                <a href="doc/handbook/declaration files/Introduction.html">
            
                    
                    如何书写声明文件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="doc/handbook/declaration files/Library Structures.html">
            
                <a href="doc/handbook/declaration files/Library Structures.html">
            
                    
                    结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="doc/handbook/declaration files/Do's and Don'ts.html">
            
                <a href="doc/handbook/declaration files/Do's and Don'ts.html">
            
                    
                    规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="doc/handbook/declaration files/By Example.html">
            
                <a href="doc/handbook/declaration files/By Example.html">
            
                    
                    举例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="doc/handbook/declaration files/Deep Dive.html">
            
                <a href="doc/handbook/declaration files/Deep Dive.html">
            
                    
                    深入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="doc/handbook/declaration files/Publishing.html">
            
                <a href="doc/handbook/declaration files/Publishing.html">
            
                    
                    发布
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="doc/handbook/declaration files/Consumption.html">
            
                <a href="doc/handbook/declaration files/Consumption.html">
            
                    
                    使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="doc/handbook/tsconfig.json.html">
            
                <a href="doc/handbook/tsconfig.json.html">
            
                    
                    工程配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="doc/handbook/tsconfig.json.html">
            
                <a href="doc/handbook/tsconfig.json.html">
            
                    
                    tsconfig.json
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="doc/handbook/Project References.html">
            
                <a href="doc/handbook/Project References.html">
            
                    
                    工程引用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="doc/handbook/Typings for NPM Packages.html">
            
                <a href="doc/handbook/Typings for NPM Packages.html">
            
                    
                    NPM包的类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="doc/handbook/Compiler Options.html">
            
                <a href="doc/handbook/Compiler Options.html">
            
                    
                    编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="doc/handbook/Configuring Watch.html">
            
                <a href="doc/handbook/Configuring Watch.html">
            
                    
                    配置 Watch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="doc/handbook/Compiler Options in MSBuild.html">
            
                <a href="doc/handbook/Compiler Options in MSBuild.html">
            
                    
                    在MSBuild里使用编译选项
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="doc/handbook/Integrating with Build Tools.html">
            
                <a href="doc/handbook/Integrating with Build Tools.html">
            
                    
                    与其它构建工具整合
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="doc/handbook/Nightly Builds.html">
            
                <a href="doc/handbook/Nightly Builds.html">
            
                    
                    使用TypeScript的每日构建版本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="doc/wiki/">
            
                <a href="doc/wiki/">
            
                    
                    Wiki
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="doc/wiki/this-in-TypeScript.html">
            
                <a href="doc/wiki/this-in-TypeScript.html">
            
                    
                    TypeScript里的this
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="doc/wiki/coding_guidelines.html">
            
                <a href="doc/wiki/coding_guidelines.html">
            
                    
                    编码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="doc/wiki/Common Errors.html">
            
                <a href="doc/wiki/Common Errors.html">
            
                    
                    常见编译错误
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="doc/wiki/TypeScript-Editor-Support.html">
            
                <a href="doc/wiki/TypeScript-Editor-Support.html">
            
                    
                    支持TypeScript的编辑器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="doc/wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                <a href="doc/wiki/Using-TypeScript-With-ASP.NET-5.html">
            
                    
                    结合ASP.NET v5使用TypeScript
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="doc/wiki/Architectural-Overview.html">
            
                <a href="doc/wiki/Architectural-Overview.html">
            
                    
                    架构概述
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="doc/wiki/Roadmap.html">
            
                <a href="doc/wiki/Roadmap.html">
            
                    
                    发展路线图
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="doc/release-notes/">
            
                <a href="doc/release-notes/">
            
                    
                    新增功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="doc/release-notes/TypeScript 3.1.html">
            
                <a href="doc/release-notes/TypeScript 3.1.html">
            
                    
                    TypeScript 3.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="doc/release-notes/TypeScript 3.0.html">
            
                <a href="doc/release-notes/TypeScript 3.0.html">
            
                    
                    TypeScript 3.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="doc/release-notes/TypeScript 2.9.html">
            
                <a href="doc/release-notes/TypeScript 2.9.html">
            
                    
                    TypeScript 2.9
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="doc/release-notes/TypeScript 2.8.html">
            
                <a href="doc/release-notes/TypeScript 2.8.html">
            
                    
                    TypeScript 2.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="doc/release-notes/TypeScript 2.7.html">
            
                <a href="doc/release-notes/TypeScript 2.7.html">
            
                    
                    TypeScript 2.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="doc/release-notes/TypeScript 2.6.html">
            
                <a href="doc/release-notes/TypeScript 2.6.html">
            
                    
                    TypeScript 2.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="doc/release-notes/TypeScript 2.5.html">
            
                <a href="doc/release-notes/TypeScript 2.5.html">
            
                    
                    TypeScript 2.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="doc/release-notes/TypeScript 2.4.html">
            
                <a href="doc/release-notes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="doc/release-notes/TypeScript 2.3.html">
            
                <a href="doc/release-notes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="doc/release-notes/TypeScript 2.2.html">
            
                <a href="doc/release-notes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="doc/release-notes/TypeScript 2.1.html">
            
                <a href="doc/release-notes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.12" data-path="doc/release-notes/TypeScript 2.0.html">
            
                <a href="doc/release-notes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.13" data-path="doc/release-notes/TypeScript 1.8.html">
            
                <a href="doc/release-notes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.14" data-path="doc/release-notes/TypeScript 1.7.html">
            
                <a href="doc/release-notes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.15" data-path="doc/release-notes/TypeScript 1.6.html">
            
                <a href="doc/release-notes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.16" data-path="doc/release-notes/TypeScript 1.5.html">
            
                <a href="doc/release-notes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.17" data-path="doc/release-notes/TypeScript 1.4.html">
            
                <a href="doc/release-notes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.18" data-path="doc/release-notes/TypeScript 1.3.html">
            
                <a href="doc/release-notes/TypeScript 1.3.html">
            
                    
                    TypeScript 1.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.19" data-path="doc/release-notes/TypeScript 1.1.html">
            
                <a href="doc/release-notes/TypeScript 1.1.html">
            
                    
                    TypeScript 1.1
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="doc/breaking-changes/breaking-changes.html">
            
                <a href="doc/breaking-changes/breaking-changes.html">
            
                    
                    Breaking Changes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="doc/breaking-changes/TypeScript 2.4.html">
            
                <a href="doc/breaking-changes/TypeScript 2.4.html">
            
                    
                    TypeScript 2.4
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="doc/breaking-changes/TypeScript 2.3.html">
            
                <a href="doc/breaking-changes/TypeScript 2.3.html">
            
                    
                    TypeScript 2.3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="doc/breaking-changes/TypeScript 2.2.html">
            
                <a href="doc/breaking-changes/TypeScript 2.2.html">
            
                    
                    TypeScript 2.2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.4" data-path="doc/breaking-changes/TypeScript 2.1.html">
            
                <a href="doc/breaking-changes/TypeScript 2.1.html">
            
                    
                    TypeScript 2.1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.5" data-path="doc/breaking-changes/TypeScript 2.0.html">
            
                <a href="doc/breaking-changes/TypeScript 2.0.html">
            
                    
                    TypeScript 2.0
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.6" data-path="doc/breaking-changes/TypeScript 1.8.html">
            
                <a href="doc/breaking-changes/TypeScript 1.8.html">
            
                    
                    TypeScript 1.8
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.7" data-path="doc/breaking-changes/TypeScript 1.7.html">
            
                <a href="doc/breaking-changes/TypeScript 1.7.html">
            
                    
                    TypeScript 1.7
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.8" data-path="doc/breaking-changes/TypeScript 1.6.html">
            
                <a href="doc/breaking-changes/TypeScript 1.6.html">
            
                    
                    TypeScript 1.6
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.9" data-path="doc/breaking-changes/TypeScript 1.5.html">
            
                <a href="doc/breaking-changes/TypeScript 1.5.html">
            
                    
                    TypeScript 1.5
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.10" data-path="doc/breaking-changes/TypeScript 1.4.html">
            
                <a href="doc/breaking-changes/TypeScript 1.4.html">
            
                    
                    TypeScript 1.4
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="." >Introduction</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="typescript-handbook&#xFF08;&#x4E2D;&#x6587;&#x7248;&#xFF09;">TypeScript Handbook&#xFF08;&#x4E2D;&#x6587;&#x7248;&#xFF09;</h1>
<p><img src="misc/ts_logo.jpg" alt="TypeScript" width="24px" height="24px" style="vertical-align: bottom;">  <a href="https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/" target="_blank">TypeScript 3.0 (July 30, 2018)</a></p>
<blockquote>
<p>&#x4ECE;&#x524D;&#x6253;&#x5FC3;&#x773C;&#x513F;&#x91CC;&#x8BA8;&#x538C;&#x7F16;&#x8BD1;&#x6210;JavaScript&#x7684;&#x8FD9;&#x7C7B;&#x8BED;&#x8A00;&#xFF0C;&#x50CF;Coffee&#xFF0C;Dart&#x7B49;&#x3002;
&#x4F46;&#x662F;&#x5728;15&#x5E74;&#x6625;&#x8282;&#x524D;&#x540E;&#x5374;&#x7231;&#x4E0A;&#x4E86;TypeScript&#x3002;
&#x540C;&#x65F6;&#x975E;&#x5E38;&#x559C;&#x6B22;&#x7684;&#x6846;&#x67B6;Dojo&#xFF0C;Angularjs&#x4E5F;&#x5BA3;&#x5E03;&#x4F7F;&#x7528;TypeScript&#x505A;&#x65B0;&#x7248;&#x672C;&#x7684;&#x5F00;&#x53D1;&#x3002;
&#x90A3;&#x4E48;TypeScript&#x7A76;&#x7ADF;&#x4E3A;&#x4F55;&#x7269;&#xFF1F;&#x53C8;&#x6709;&#x4EC0;&#x4E48;&#x9B45;&#x529B;&#x5462;&#xFF1F;</p>
</blockquote>
<p>TypeScript&#x662F;Microsoft&#x516C;&#x53F8;&#x6CE8;&#x518C;&#x5546;&#x6807;&#x3002;</p>
<p>TypeScript&#x5177;&#x6709;&#x7C7B;&#x578B;&#x7CFB;&#x7EDF;&#xFF0C;&#x4E14;&#x662F;JavaScript&#x7684;&#x8D85;&#x96C6;&#x3002;
&#x5B83;&#x53EF;&#x4EE5;&#x7F16;&#x8BD1;&#x6210;&#x666E;&#x901A;&#x7684;JavaScript&#x4EE3;&#x7801;&#x3002;
TypeScript&#x652F;&#x6301;&#x4EFB;&#x610F;&#x6D4F;&#x89C8;&#x5668;&#xFF0C;&#x4EFB;&#x610F;&#x73AF;&#x5883;&#xFF0C;&#x4EFB;&#x610F;&#x7CFB;&#x7EDF;&#x5E76;&#x4E14;&#x662F;&#x5F00;&#x6E90;&#x7684;&#x3002;</p>
<p>TypeScript&#x76EE;&#x524D;&#x8FD8;&#x5728;&#x79EF;&#x6781;&#x7684;&#x5F00;&#x53D1;&#x5B8C;&#x5584;&#x4E4B;&#x4E2D;&#xFF0C;&#x4E0D;&#x65AD;&#x5730;&#x4F1A;&#x6709;&#x65B0;&#x7684;&#x7279;&#x6027;&#x52A0;&#x5165;&#x8FDB;&#x6765;&#x3002;
&#x56E0;&#x6B64;&#x672C;&#x624B;&#x518C;&#x4E5F;&#x4F1A;&#x7D27;&#x968F;&#x5B98;&#x65B9;&#x7684;&#x6BCF;&#x4E2A;commit&#xFF0C;&#x4E0D;&#x65AD;&#x5730;&#x66F4;&#x65B0;&#x65B0;&#x7684;&#x7AE0;&#x8282;&#x4EE5;&#x53CA;&#x4FEE;&#x6539;&#x63AA;&#x8BCD;&#x4E0D;&#x59A5;&#x4E4B;&#x5904;&#x3002;</p>
<p>&#x5982;&#x679C;&#x4F60;&#x5BF9;TypeScript&#x4E00;&#x89C1;&#x949F;&#x60C5;&#xFF0C;&#x53EF;&#x4EE5;&#x8BA2;&#x9605;<del>and star</del>&#x672C;&#x624B;&#x518C;&#xFF0C;&#x53CA;&#x65F6;&#x4E86;&#x89E3;ECMAScript 2015&#x4EE5;&#x53CA;2016&#x91CC;&#x65B0;&#x7684;&#x539F;&#x751F;&#x7279;&#x6027;&#xFF0C;&#x5E76;&#x501F;&#x52A9;TypeScript&#x63D0;&#x524D;&#x638C;&#x63E1;&#x4F7F;&#x7528;&#x5B83;&#x4EEC;&#x7684;&#x65B9;&#x5F0F;&#xFF01;
&#x5982;&#x679C;&#x4F60;&#x5BF9;TypeScript&#x7684;&#x7231;&#x6108;&#x53D1;&#x6D53;&#x70C8;&#xFF0C;&#x53EF;&#x4EE5;&#x4E0E;&#x697C;&#x4E3B;&#x4E00;&#x8D77;&#x8FB9;&#x7FFB;&#x8BD1;&#x8FB9;&#x5B66;&#x4E60;&#xFF0C;<em><a href="https://github.com/zhongsp/TypeScript/pulls" target="_blank">PRs Welcome!!!</a></em>
&#x5728;<a href="#&#x76F8;&#x5173;&#x94FE;&#x63A5;">&#x76F8;&#x5173;&#x94FE;&#x63A5;</a>&#x7684;&#x672B;&#x5C3E;&#x53EF;&#x4EE5;&#x627E;&#x5230;&#x672C;&#x624B;&#x518C;&#x7684;<a href="https://github.com/zhongsp/TypeScript" target="_blank">Github&#x5730;&#x5740;</a>&#x3002;</p>
<h2 id="&#x76EE;&#x5F55;">&#x76EE;&#x5F55;</h2>
<ul>
<li><a href="doc/handbook/tutorials/README.html">&#x5FEB;&#x901F;&#x4E0A;&#x624B;</a><ul>
<li><a href="doc/handbook/tutorials/TypeScript%20in%205%20minutes.html">5&#x5206;&#x949F;&#x4E86;&#x89E3;TypeScript</a></li>
<li><a href="doc/handbook/tutorials/ASP.NET%20Core.html">ASP.NET Core</a></li>
<li><a href="doc/handbook/tutorials/ASP.NET%204.html">ASP.NET 4</a></li>
<li><a href="doc/handbook/tutorials/Gulp.html">Gulp</a></li>
<li><a href="doc/handbook/tutorials/Knockout.html">Knockout.js</a></li>
<li><a href="doc/handbook/tutorials/React%20&amp;%20Webpack.html">React&#x4E0E;webpack</a></li>
<li><a href="doc/handbook/tutorials/React.html">React</a></li>
<li><a href="doc/handbook/tutorials/Angular%202.html">Angular 2</a></li>
<li><a href="doc/handbook/tutorials/Migrating%20from%20JavaScript.html">&#x4ECE;JavaScript&#x8FC1;&#x79FB;&#x5230;TypeScript</a></li>
</ul>
</li>
<li><a href="doc/handbook/README.html">&#x624B;&#x518C;</a><ul>
<li><a href="doc/handbook/Basic%20Types.html">&#x57FA;&#x7840;&#x7C7B;&#x578B;</a></li>
<li><a href="doc/handbook/Variable%20Declarations.html">&#x53D8;&#x91CF;&#x58F0;&#x660E;</a></li>
<li><a href="doc/handbook/Interfaces.html">&#x63A5;&#x53E3;</a></li>
<li><a href="doc/handbook/Classes.html">&#x7C7B;</a></li>
<li><a href="doc/handbook/Functions.html">&#x51FD;&#x6570;</a></li>
<li><a href="doc/handbook/Generics.html">&#x6CDB;&#x578B;</a></li>
<li><a href="doc/handbook/Enums.html">&#x679A;&#x4E3E;</a></li>
<li><a href="doc/handbook/Type%20Inference.html">&#x7C7B;&#x578B;&#x63A8;&#x8BBA;</a></li>
<li><a href="doc/handbook/Type%20Compatibility.html">&#x7C7B;&#x578B;&#x517C;&#x5BB9;&#x6027;</a></li>
<li><a href="doc/handbook/Advanced%20Types.html">&#x9AD8;&#x7EA7;&#x7C7B;&#x578B;</a></li>
<li><a href="doc/handbook/Utilit%20Types.html">&#x5B9E;&#x7528;&#x5DE5;&#x5177;&#x7C7B;&#x578B;</a></li>
<li><a href="doc/handbook/Symbols.html">Symbols</a></li>
<li><a href="doc/handbook/Iterators%20and%20Generators.html">Iterators &#x548C; Generators</a></li>
<li><a href="doc/handbook/Modules.html">&#x6A21;&#x5757;</a></li>
<li><a href="doc/handbook/Namespaces.html">&#x547D;&#x540D;&#x7A7A;&#x95F4;</a></li>
<li><a href="doc/handbook/Namespaces%20and%20Modules.html">&#x547D;&#x540D;&#x7A7A;&#x95F4;&#x548C;&#x6A21;&#x5757;</a></li>
<li><a href="doc/handbook/Module%20Resolution.html">&#x6A21;&#x5757;&#x89E3;&#x6790;</a></li>
<li><a href="doc/handbook/Declaration%20Merging.html">&#x58F0;&#x660E;&#x5408;&#x5E76;</a></li>
<li><a href="doc/handbook/Writing%20Definition%20Files.html">&#x4E66;&#x5199;.d.ts&#x6587;&#x4EF6;</a></li>
<li><a href="doc/handbook/JSX.html">JSX</a></li>
<li><a href="doc/handbook/Decorators.html">Decorators</a></li>
<li><a href="doc/handbook/Mixins.html">&#x6DF7;&#x5165;</a></li>
<li><a href="doc/handbook/Triple-Slash%20Directives.html">&#x4E09;&#x659C;&#x7EBF;&#x6307;&#x4EE4;</a></li>
<li><a href="doc/handbook/Type%20Checking%20JavaScript%20Files.html">JavaScript&#x6587;&#x4EF6;&#x91CC;&#x7684;&#x7C7B;&#x578B;&#x68C0;&#x67E5;</a></li>
</ul>
</li>
<li><a href="doc/handbook/declaration%20files/Introduction.html">&#x5982;&#x4F55;&#x4E66;&#x5199;&#x58F0;&#x660E;&#x6587;&#x4EF6;</a><ul>
<li><a href="doc/handbook/declaration%20files/Library%20Structures.html">&#x7ED3;&#x6784;</a></li>
<li><a href="doc/handbook/declaration%20files/Do%27s%20and%20Don%27ts.html">&#x89C4;&#x8303;</a></li>
<li><a href="doc/handbook/declaration%20files/By%20Example.html">&#x4E3E;&#x4F8B;</a></li>
<li><a href="doc/handbook/declaration%20files/Deep%20Dive.html">&#x6DF1;&#x5165;</a></li>
<li><a href="doc/handbook/declaration%20files/Publishing.html">&#x53D1;&#x5E03;</a></li>
<li><a href="doc/handbook/declaration%20files/Consumption.html">&#x4F7F;&#x7528;</a></li>
</ul>
</li>
<li><a href="doc/handbook/tsconfig.json.html">&#x5DE5;&#x7A0B;&#x914D;&#x7F6E;</a><ul>
<li><a href="doc/handbook/tsconfig.json.html">tsconfig.json</a></li>
<li><a href="doc/handbook/Project%20References.html">&#x5DE5;&#x7A0B;&#x5F15;&#x7528;</a></li>
<li><a href="doc/handbook/Typings%20for%20NPM%20Packages.html">NPM&#x5305;&#x7684;&#x7C7B;&#x578B;</a></li>
<li><a href="doc/handbook/Compiler%20Options.html">&#x7F16;&#x8BD1;&#x9009;&#x9879;</a></li>
<li><a href="doc/handbook/Configuring%20Watch.html">&#x914D;&#x7F6E; Watch</a></li>
<li><a href="doc/handbook/Compiler%20Options%20in%20MSBuild.html">&#x5728;MSBuild&#x91CC;&#x4F7F;&#x7528;&#x7F16;&#x8BD1;&#x9009;&#x9879;</a></li>
<li><a href="doc/handbook/Integrating%20with%20Build%20Tools.html">&#x4E0E;&#x5176;&#x5B83;&#x6784;&#x5EFA;&#x5DE5;&#x5177;&#x6574;&#x5408;</a></li>
<li><a href="doc/handbook/Nightly%20Builds.html">&#x4F7F;&#x7528;TypeScript&#x7684;&#x6BCF;&#x65E5;&#x6784;&#x5EFA;&#x7248;&#x672C;</a></li>
</ul>
</li>
<li><a href="doc/wiki/README.html">Wiki</a><ul>
<li><a href="doc/wiki/this-in-TypeScript.html">TypeScript&#x91CC;&#x7684;this</a></li>
<li><a href="doc/wiki/coding_guidelines.html">&#x7F16;&#x7801;&#x89C4;&#x8303;</a></li>
<li><a href="doc/wiki/Common%20Errors.html">&#x5E38;&#x89C1;&#x7F16;&#x8BD1;&#x9519;&#x8BEF;</a></li>
<li><a href="doc/wiki/TypeScript-Editor-Support.html">&#x652F;&#x6301;TypeScript&#x7684;&#x7F16;&#x8F91;&#x5668;</a></li>
<li><a href="doc/wiki/Using-TypeScript-With-ASP.NET-5.html">&#x7ED3;&#x5408;ASP.NET v5&#x4F7F;&#x7528;TypeScript</a></li>
<li><a href="doc/wiki/Architectural-Overview.html">&#x67B6;&#x6784;&#x6982;&#x8FF0;</a></li>
<li><a href="doc/wiki/Roadmap.html">&#x53D1;&#x5C55;&#x8DEF;&#x7EBF;&#x56FE;</a></li>
</ul>
</li>
<li><a href="doc/release-notes/README.html">&#x65B0;&#x589E;&#x529F;&#x80FD;</a><ul>
<li><a href="doc/release-notes/TypeScript%203.1.html">TypeScript 3.1</a></li>
<li><a href="doc/release-notes/TypeScript%203.0.html">TypeScript 3.0</a></li>
<li><a href="doc/release-notes/TypeScript%202.9.html">TypeScript 2.9</a></li>
<li><a href="doc/release-notes/TypeScript%202.8.html">TypeScript 2.8</a></li>
<li><a href="doc/release-notes/TypeScript%202.7.html">TypeScript 2.7</a></li>
<li><a href="doc/release-notes/TypeScript%202.6.html">TypeScript 2.6</a></li>
<li><a href="doc/release-notes/TypeScript%202.5.html">TypeScript 2.5</a></li>
<li><a href="doc/release-notes/TypeScript%202.4.html">TypeScript 2.4</a></li>
<li><a href="doc/release-notes/TypeScript%202.3.html">TypeScript 2.3</a></li>
<li><a href="doc/release-notes/TypeScript%202.2.html">TypeScript 2.2</a></li>
<li><a href="doc/release-notes/TypeScript%202.1.html">TypeScript 2.1</a></li>
<li><a href="doc/release-notes/TypeScript%202.0.html">TypeScript 2.0</a></li>
<li><a href="doc/release-notes/TypeScript%201.8.html">TypeScript 1.8</a></li>
<li><a href="doc/release-notes/TypeScript%201.7.html">TypeScript 1.7</a></li>
<li><a href="doc/release-notes/TypeScript%201.6.html">TypeScript 1.6</a></li>
<li><a href="doc/release-notes/TypeScript%201.5.html">TypeScript 1.5</a></li>
<li><a href="doc/release-notes/TypeScript%201.4.html">TypeScript 1.4</a></li>
<li><a href="doc/release-notes/TypeScript%201.3.html">TypeScript 1.3</a></li>
<li><a href="doc/release-notes/TypeScript%201.1.html">TypeScript 1.1</a></li>
</ul>
</li>
<li><a href="doc/breaking-changes/breaking-changes.html">Breaking Changes</a><ul>
<li><a href="doc/breaking-changes/TypeScript%202.4.html">TypeScript 2.4</a></li>
<li><a href="doc/breaking-changes/TypeScript%202.3.html">TypeScript 2.3</a></li>
<li><a href="doc/breaking-changes/TypeScript%202.2.html">TypeScript 2.2</a></li>
<li><a href="doc/breaking-changes/TypeScript%202.1.html">TypeScript 2.1</a></li>
<li><a href="doc/breaking-changes/TypeScript%202.0.html">TypeScript 2.0</a></li>
<li><a href="doc/breaking-changes/TypeScript%201.8.html">TypeScript 1.8</a></li>
<li><a href="doc/breaking-changes/TypeScript%201.7.html">TypeScript 1.7</a></li>
<li><a href="doc/breaking-changes/TypeScript%201.6.html">TypeScript 1.6</a></li>
<li><a href="doc/breaking-changes/TypeScript%201.5.html">TypeScript 1.5</a></li>
<li><a href="doc/breaking-changes/TypeScript%201.4.html">TypeScript 1.4</a></li>
</ul>
</li>
</ul>
<h2 id="&#x6700;&#x65B0;&#x4FEE;&#x6539;">&#x6700;&#x65B0;&#x4FEE;&#x6539;</h2>
<ul>
<li>2018-08-15 &#x65B0;&#x589E;&#x7AE0;&#x8282;&#xFF1A;<a href="doc/handbook/Project%20References.html">&#x5DE5;&#x7A0B;&#x5F15;&#x7528;</a></li>
<li><a href="doc/release-notes/TypeScript%203.0.html">TypeScript 3.0</a></li>
</ul>
<h2 id="&#x76F8;&#x5173;&#x94FE;&#x63A5;">&#x76F8;&#x5173;&#x94FE;&#x63A5;</h2>
<ul>
<li><a href="http://typescriptlang.org" target="_blank">TypeScript&#x5B98;&#x7F51;</a></li>
<li><a href="https://github.com/Microsoft/TypeScript" target="_blank">TypeScript on Github</a></li>
<li><a href="https://github.com/Microsoft/TypeScript/blob/master/doc/spec.html" target="_blank">TypeScript&#x8BED;&#x8A00;&#x89C4;&#x8303;</a></li>
<li><a href="https://github.com/zhongsp/TypeScript" target="_blank">&#x672C;&#x624B;&#x518C;&#x4E2D;&#x6587;&#x7248;Github&#x5730;&#x5740;</a></li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="doc/handbook/tutorials/" class="navigation navigation-next navigation-unique" aria-label="Next page: 快速上手">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Introduction","level":"1.1","depth":1,"next":{"title":"快速上手","level":"1.2","depth":1,"path":"doc/handbook/tutorials/README.md","ref":"./doc/handbook/tutorials/README.md","articles":[{"title":"5分钟了解TypeScript","level":"1.2.1","depth":2,"path":"doc/handbook/tutorials/TypeScript in 5 minutes.md","ref":"./doc/handbook/tutorials/TypeScript in 5 minutes.md","articles":[]},{"title":"ASP.NET Core","level":"1.2.2","depth":2,"path":"doc/handbook/tutorials/ASP.NET Core.md","ref":"./doc/handbook/tutorials/ASP.NET Core.md","articles":[]},{"title":"ASP.NET 4","level":"1.2.3","depth":2,"path":"doc/handbook/tutorials/ASP.NET 4.md","ref":"./doc/handbook/tutorials/ASP.NET 4.md","articles":[]},{"title":"Gulp","level":"1.2.4","depth":2,"path":"doc/handbook/tutorials/Gulp.md","ref":"./doc/handbook/tutorials/Gulp.md","articles":[]},{"title":"Knockout.js","level":"1.2.5","depth":2,"path":"doc/handbook/tutorials/Knockout.md","ref":"./doc/handbook/tutorials/Knockout.md","articles":[]},{"title":"React与webpack","level":"1.2.6","depth":2,"path":"doc/handbook/tutorials/React & Webpack.md","ref":"./doc/handbook/tutorials/React & Webpack.md","articles":[]},{"title":"React","level":"1.2.7","depth":2,"path":"doc/handbook/tutorials/React.md","ref":"./doc/handbook/tutorials/React.md","articles":[]},{"title":"Angular 2","level":"1.2.8","depth":2,"path":"doc/handbook/tutorials/Angular 2.md","ref":"./doc/handbook/tutorials/Angular 2.md","articles":[]},{"title":"从JavaScript迁移到TypeScript","level":"1.2.9","depth":2,"path":"doc/handbook/tutorials/Migrating from JavaScript.md","ref":"./doc/handbook/tutorials/Migrating from JavaScript.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","author":"Patrick Zhong","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"preface.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"TypeScript Handbook","language":"zh-hans","gitbook":">3.0.0","description":"Translation of official TypeScript Handbook"},"file":{"path":"preface.md","mtime":"2018-10-13T09:48:54.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-10-13T09:57:42.904Z"},"basePath":".","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="gitbook/gitbook.js"></script>
    <script src="gitbook/theme.js"></script>
    
        
        <script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

